home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
MacHack 2000
/
MacHack 2000.toast
/
pc
/
The Hacks
/
Softshoe
/
Lisa's Mac Parts
/
Views
/
Pane Frames
/
JustifiedFrame.cp
< prev
next >
Wrap
Text File
|
2000-06-23
|
2KB
|
78 lines
// JustifiedFrame.cp
#ifndef JustifiedFrame_h
#include "JustifiedFrame.h"
#endif
#ifndef CellVisitor_h
#include "CellVisitor.h"
#endif
#ifndef Justification_h
#include "Justification.h"
#endif
#ifndef Overflow_h
#include "Overflow.h"
#endif
JustifiedFrame::JustifiedFrame( const Announcing<UPoint32>& size,
const Justification& h,
const Justification& v )
: PaneStack( size ),
interior( *this ),
exterior( *this ),
horizontal( h ),
vertical( v )
{
}
void JustifiedFrame::Arrange( UPoint32 size )
{
Rectangle32 outside( 0, 0, Asint32( size.h ), Asint32( size.v ) );
Rectangle32 inside( outside );
horizontal.InsetWidth( inside, interior.Sizer().BestWidth( outside.Horizontal() ) );
vertical.InsetHeight( inside, interior.Sizer().BestHeight( outside.Vertical() ) );
interior.SetBounds( inside );
exterior.SetBounds( outside );
}
int32 JustifiedFrame::MinimumWidth() const
{
return interior.Sizer().MinimumWidth();
}
int32 JustifiedFrame:: MinimumHeight() const
{
return interior.Sizer().MinimumHeight();
}
int32 JustifiedFrame:: MaximumWidth() const
{
return exterior.Sizer().MaximumWidth();
}
int32 JustifiedFrame:: MaximumHeight() const
{
return exterior.Sizer().MaximumHeight();
}
int32 JustifiedFrame:: ReasonableWidth() const
{
return interior.Sizer().ReasonableWidth();
}
int32 JustifiedFrame:: ReasonableHeight() const
{
return interior.Sizer().ReasonableHeight();
}
int32 JustifiedFrame::BestWidth( Range32 bounds ) const
{
return interior.Sizer().BestWidth( bounds );
}
int32 JustifiedFrame::BestHeight( Range32 bounds ) const
{
return interior.Sizer().BestHeight( bounds );
}